<template>
  <EleTableComp :config="config">
    <template v-slot:costomLook="slotData">
      <registerLook :data="slotData.data"></registerLook>
    </template>
    <template v-slot:registerAdd="slotData">
      <register-add :data="slotData.data"></register-add>
    </template>
    <template v-slot:registerEnit="slotData">
      <register-Enit :data="slotData.data"></register-Enit>
    </template>
    <template v-slot:registerDelte="slotData">
      <register-delte :data="slotData.data"></register-delte>
    </template>
    <template slot="headerAppend">
      <div class="headerAppend">
        <div class="span_por">
          <span></span>
          <p>已复查</p>
        </div>
        <div class="span_por">
          <span></span>
          <p>已整改</p>
        </div>
        <div class="span_por">  
          <span></span>
          <p>已核查</p>
        </div>
      </div>
    </template>
  </EleTableComp>
</template>
<script>
import EleTableComp from "@/components/EleTableComp";
import { typeJson } from "@/components/EleTableComp/config";
import registerLook from "./registerLook";
import registerAdd from "./registerAdd";
import registerDelte from "./registerDelte";
import registerEnit from "./registerEnit";
export default {
  data() {
    return {
      config: {
        header: {
          breadcrumb: '',
          addButton: false,
          addButtonSlot: "registerAdd",
          search: [
            {
              type: "datePicker",
              value: "",
              prop: "startDate",
              label: "发现时间",
            },
            {
              type: "datePicker",
              value: "",
              prop: "endDate",
              label: "至",
            },
            {
              type: "dropDown",
              prop: "verifyStatus",
              value: "",
              label: "核查状态",
              list: typeJson.verifyStatus,
            },
            {
              type: "dropDown",
              prop: "rectifyStatus",
              value: "",
              label: "整改状态",
              list: typeJson.rectifyStatus,
            },
            {
              type: "dropDown",
              prop: "reviewStatus",
              value: "",
              label: "复查状态",
              list: typeJson.reviewStatus,
            },
            {
              type: "datePicker",
              value: "",
              prop: "expiresStartDate",
              label: "整改期限",
            },
            {
              type: "datePicker",
              value: "",
              prop: "expiresEndDate",
              label: "至",
            },
            {
              type: "dropDown",
              prop: "level",
              value: "",
              label: "隐患级别",
              list: typeJson.level,
            },
            {
              label: "隐患来源",
              prop: "source",
              type: "dropDown",
              list: typeJson.source,
              value: "",
            },
            // {
            //   label: "发现方式",
            //   prop: "discoverWay",
            //   type: "dropDown",
            //   list: typeJson.riskRule,
            //   value: "",
            // },
          ],
          // qmexport: {
          //   url: `/riskExcludeNew/pdfExport/${this.$store.state.mineId}`,
          //   method: "GET",
          //   mineId: true,
          //   currentPage: 1,
          //   pageSize: 10,
          //   filename: "电子签名",
          //   data: {},
          // },
        },
        backgroundColor: "color",
        table: [
           {
            type: "selection",
            
          },
          {
            type: "index",
            addEditHidden: true,
          },
          {
            label: "描述",
            prop: "content",
            value: "",
            addEditType: "textArea",
            hidden: true,
            required: true,
          },
          {
            label: "来源",
            prop: "source",
            type: "dropDown",
            addEditType: "dropDown",
            list: typeJson.source,
            value: "",
            required: true,
          },
          {
            label: "部位",
            prop: "part",
            hidden: true,
            value: "",
          },
          {
            label: "级别",
            prop: "level",
            type: "dropDown",
            addEditHidden: "dropDown",
            list: typeJson.level,
            value: "",
            required: true,
          },
          // {
          //   label: "发现方式",
          //   prop: "discoverWay",
          //   type: "dropDown",
          //   addEditHidden: true,
          //   list: typeJson.riskRule,
          //   value: "",
          // },
          // {
          //   label: "发现人",
          //   prop: "discoverMan",
          //   value: "",
          //   addEditHidden: true,
          // },
        
          // {
          //   label: "发现人",
          //   prop: "discoverManId",
          //   addEditType: "netDropDown",
          //   list: {
          //     url: "/system/user/list",
          //     label: "nickName",
          //     method: "get",
          //     value: "memberId",
          //     // params: {
          //     //   mineId: 1,
          //     // },
          //   },
          //   value: "",
          //   hidden: true,
          //   required: true,
          // },
          {
            label: "发现时间",
            prop: "discoverDate",
            value: "",
            addEditType: "timePicker",
            required: true,
          },
          {
            label: "核查时间",
            prop: "verifyDate",
            value: "",
            addEditType: "timePicker",
          },
        
          {
            label: "核查状态",
            prop: "verifyStatus",
            type: "dropDown",
            addEditHidden: true,
            list: typeJson.verifyStatus,
            value: "",
          },
          {
            label: "整改类型",
            prop: "rectifyType",
            addEditType: "dropDown",
            type: "dropDown",
            addEditHidden: true,
            list: typeJson.rectifyType,
            value: "",
          },
          {
            label: "整改方式",
            prop: "rectifyWay",
            type: "dropDown",
            list: typeJson.rectifyWay,
            addEditHidden: true,
            hidden: true,
            value: "",
          },
          {
            label: "整改期限",
            prop: "rectifyExpires",
            addEditHidden: true,
            value: "",
          },
          {
            label: "整改负责人",
            prop: "rectifyMan",
            value: "",
            addEditHidden: true,
          },
          {
            label: "联系电话",
            prop: "phone",
            value: "",
            addEditHidden: true,
          },
          {
            label: "整改确认状态",
            prop: "rectifyConfirmStatus",
            value: "",
            addEditHidden: true,
            list: typeJson.rectifyConfirmStatus,
          },
          {
            label: "整改完成日期",
            prop: "rectifyFinishDate",
            value: "",
            addEditHidden: true,
          },
          {
            label: "整改状态",
            prop: "rectifyStatus",
            type: "dropDown",
            list: typeJson.rectifyStatus,
            addEditHidden: true,
            value: "",
          },
          {
            label: "复查时间",
            prop: "reviewDate",
            addEditHidden: true,
            value: "",
          },
          // {
          //   label: "复查人或单位",
          //   prop: "reviewMan",
          //   addEditHidden: true,
          //   value: "",
          // },
          {
            label: "复查状态",
            prop: "reviewStatus",
            type: "dropDown",
            list: typeJson.reviewStatus,
            addEditHidden: true,
            value: "",
          },
          // {
          //   label: "隐患类别",
          //   prop: "category",
          //   addEditType: "cascader",
          //   list: {
          //     url: "/riskCategory/getTree?",
          //     label: "name",
          //     method: "GET",
          //     value: "id",
          //     data: {},
          //   },
          //   value: "",
          //   hidden: true,
          // },
          // {
          //   label: "检查名称",
          //   prop: "planName",
          //   value: "",
          // },
          {
            label: "隐患图片",
            prop: "riskPhoto",
            hidden: true,
            addEditType: "upload",
            value: "",
          },
          {
            label: "操作",
            prop: "", // 传数据的时候 忽略
            type: "operation",
            addEditHidden: true,
            isParam: false,
            edit: true,
            delete: true,
            look: false,
            mineType:1, 
            slotName: ["costomLook"],
          },
        ],
        update: {
          url: "/app/riskExcludeNew/update",
          method: "POST",
          data: this.form,
        },
        delete: {
          url: "/app/riskExcludeNew/delete",
          method: "GET",
          id: -1,
        },
        insert: {
          url: "/app/riskExcludeNew/insert",
          method: "POST",
          data: this.form,
          mineId: true,
        },
        select: {
          url: "/app/riskExcludeNew/getList",
          method: "POST",
          mineId: true,
          currentPage: 1,
          pageSize: 5,
          data: {},
        },
      },
    };
  },
  components: {
    EleTableComp,
    registerLook,
    registerAdd,
    registerDelte,
    registerEnit,
  },
};
</script>
<style lang="scss" scoped>
:deep(){
  .el-table {
    tbody tr {
      &:hover {
        td {
          background-color: rgba(255, 255, 255, 0);
        }
      }
    }
  }
}
//表格鼠标悬浮时的样式 （高亮）

:deep(.el-table) {
  height: 45vh !important;
}
:deep(.bata_table) {
  margin-bottom: 200px;
}
.headerAppend {
  position: absolute;
  // left: 2%;
  right: 0;
  width: 300px;
  display: flex;
  .span_por {
    display: flex;
    align-items: center;
    margin-right: 20px;
    &:nth-child(1) > span {
      display: inline-block;
      width: 16px;
      height: 16px;
      border-radius: 3px;
      background-color: #7ef289;
    }
    &:nth-child(2) > span {
      display: inline-block;
      width: 16px;
      height: 16px;
      border-radius: 3px;
      //background-color: #A0FFEC;
      background-color: #aedffd;
    }
    &:nth-child(3) > span {
      display: inline-block;
      width: 16px;
      height: 16px;
      border-radius: 3px;
      // background-color:#AEDFFD;
      background-color: #a0ffec;
    }
    p {
      font-size: 16px;
      margin-left: 10px;
      font-weight: 400;
      color: #333333;
    }
  }
}
:deep(.right-select) {
  padding: 5px 12px;
  .right_base {
    .private {
      margin-top: 10px;
      margin-right: 50px;
      &:nth-child(1) {
        margin-right: 0;
      }
      &:nth-child(6) {
        margin-right: 0;
      }
      &:nth-child(10) {
        margin-right: 200px;
      }
      &:nth-child(11) {
        margin-left: 1260px;
      }
    }
  }
}
</style>
